//
// Created by lenovo on 2024/1/11.
//

#include "Function.h"

double Funcs::getValue() {

    return this->
        _identified_funcs->at(this->FuncType)
        ->calc(
                convert(
                        this->_argv)
                );
}

std::vector<double> convert( const std::vector<Evaluable*>& _argv ){
    std::vector<double> argv ;
    argv.reserve(_argv.size());

    for (auto e : _argv){
        argv.push_back(e->getValue());
    }

    return argv;
}